﻿// -------------------------------------------------------------------------
//    @FileName         :    NFTransRoleOnline.h
//    @Author           :    gaoyi
//    @Date             :    2025-03-27
//    @Email			:    445267987@qq.com
//    @Module           :    NFTransRoleOnline
//
// -------------------------------------------------------------------------

#pragma once

#include <proto_svr_common.pb.h>
#include "NFLogicCommon/NFLogicShmTypeDefines.h"
#include "NFTransBatchDetailBase.h"
#include "proto_common_role.nanopb.h"
#include "proto_svr_sns.pb.h"

class NFTransRoleOnline : public NF_OBJECT_TEMPLATE_MACRO(NFTransRoleOnline, EOT_TRANS_ROLE_ONLINE, NFTransBatchDetailBase)
public:
    NFTransRoleOnline();

    ~NFTransRoleOnline() override;

    int CreateInit();

    int ResumeInit();

public:
    int GetCacheDataRes(int ullId, int iTableId, int iReason, int32_t errCode, google::protobuf::Message* pMessage) override;
    int InsertCacheDataRes(int ullId, int iTableId, int iReason, int32_t errCode, google::protobuf::Message* pMessage) override;
public:
    int RoleLogin(const proto_ff::Proto_GSLoginReq* pGsReq);
    int OnRoleLogin(int errCode);
    int OnRoleRestore(int errCode);
public:
    int InsertRoleDetailReq(int iReason);
    int InsertRoleSimpleReq(int iReason);
public:
    int OnTransFinished(int iRunLogicRetCode) override;
private:
    int m_cmd;
    int m_logicSvrId;
    Proto_RoleSimpleInfo m_simpleInfo;
    uint32_t m_lastLoginTime;
    uint32_t m_lastLogoutTime;
};
